import  React from 'react'

export interface User{
  id:string,
  name:string,
  token:string
}

interface SearchPanelProps{
  users:User[],
  param:{
    name: string
    personId: string
  },
  setParam:(param:SearchPanelProps['param'])=>void
}
export function SearchPanel({users,param,setParam}:SearchPanelProps) {
  //console.log('search',users);
  //console.log('search',param);
  return (

    <form>
      <div>
        <input type="text" value={param.name} onChange={e=>setParam({
          ...param,
          name:e.target.value
        })} placeholder={'项目名称'}/>
        <select value={param.personId} onChange={e=>setParam({
          ...param,
          personId:e.target.value
        })}>
          <option value={''}>负责人</option>
          {
            users.map(users=><option value={users["id"]} key={users.id}>{users.name}</option>)
          }
        </select>
      </div>
    </form>
  )
}
